<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  添加员工信息 <a href="emp/tosave">添加员工</a>
 查询全部部门 <a href="dept/findAll">查询全部部门</a><br/><br/><br/>
  测试重定向:<a href="user/toLogin">重定向到WebRoot下的页面 (不能是WEB-INF下的)</a>
  
  
  存储数据到页面:
  <form action="user/saveEmp4" method="post">
  姓名:<input type="text" name="ename" value="admin"><br/>
  工作:<input type="text" name="job" value="manager"><br/>
 部门:<input type="text" name="dept.dname" value="finace"><br/> 
  	<input type="submit" value="提交">
  </form><br/>
  
  访问输入输出流:<a href="user/writer">流对象</a><br/>
  访问ServletAPI:<a href="user/servlet"> 访问ServletAPI</a><br/>
  请求参数封装到实体对象:
   <form action="user/saveEmp" method="post">
  姓名:<input type="text" name="ename" value="张无忌"><br/>
  工作:<input type="text" name="job" value="经理"><br/>
 部门:<input type="text" name="dept.dname" value="市场部"><br/> 
  	<input type="submit" value="提交">
  </form><br/>
  获取请求参数:
  <form action="user/saveUser" method="post">
  姓名:<input type="text" name="username" value="张无忌"><br/>
  年龄:<input type="text" name="age" value="35"><br/>
  	<input type="submit" value="提交">
  </form><br/>
  
  模拟put请求:
  <form action="user/update" method="post">
  <input type="hidden" name="_method" value="PUT"><!-- DELETE -->
  姓名:<input type="text" name="username" value="张无忌"><br/>
  年龄:<input type="text" name="age" value="35"><br/>
  	<input type="submit" value="提交">
  </form><br/>
  Ant风格的URL:<a href="user/delete/1001/35">删除用户</a><br/>
  Ant风格的URL:<a href="user/abc/search">查询用户</a><br/>
  
  <form action="user/get" method="post">
  姓名:<input type="text" name="username" value="张无忌"><br/>
  年龄:<input type="text" name="age" value="35"><br/>
  	<input type="submit" value="提交">
  </form>
    <a href="${pageContext.request.contextPath}/user/get">获取用户</a> <br>
    <a href="${pageContext.request.contextPath}/user/save">添加用户</a> <br>
  </body>
</html>
